import request from '@/utils/request'

// 获取一类专题下的试卷
export function toGetPapers(query) {
  return request({
    url: '/exam/getPapersInTopic',
    method: 'get',
    params: query
  })
}

// 获取试卷列表
export function toGetPapersList(query) {
  return request({
    url: '/exam/toGetPapersList',
    method: 'get',
    params: query
  })
}

export function toPublish(data) {
  return request({
    url: '/exam/toPublish',
    method: 'post',
    data: data
  })
}

export function toSingleHandle(data) {
  return request({
    url: '/exam/toSingleHandle',
    method: 'post',
    data: data
  })
}

export function toGetName(id) {
  return request({
    url: '/exam/getTopicName/' + id,
    method: 'get'
  })
}

export function tobulkHandle(data) {
  return request({
    url: '/exam/toHandlePaperIdArr',
    method: 'post',
    data: data
  })
}

export function toRemoveInTopic(data) {
  return request({
    url: '/exam/removeInPaper',
    method: 'post',
    data: data
  })
}

export function toGetPaperInfo(paperId) {
  return request({
    url: '/exam/editPaperInfo/' + paperId,
    method: 'get'
  })
}

export function paperEditSave(data) {
  return request({
    url: '/exam/paperEditSave',
    method: 'post',
    data: data
  })
}

export function toGetTopicList(data) {
  return request({
    url: '/exam/editToGetTopic',
    method: 'get'
  })
}

export function toGetPaperDetail(paperId) {
  return request({
    url: '/exam/toGetPaperDetail/' + paperId,
    method: 'get'
  })
}

export function toGetAllTopic(paperId) {
  return request({
    url: '/exam/toGetAllTopic/' + paperId,
    method: 'get'
  })
}

export function getUserExamInfo(query) {
  return request({
    url: '/exam/getUserExamInfo',
    method: 'get',
    params: query
  })
}

export function toGetExamTopic() {
  return request({
    url: '/exam/toGetExamTopic',
    method: 'get'
  })
}

export function toGetSheet(examId) {
  if (!examId) {
    examId = 1
  }
  return request({
    url: '/exam/toGetSheet/' + examId,
    method: 'get'
  })
}

export function delExamInfo(id) {
  return request({
    url: '/exam/delExamInfo/' + id,
    method: 'get'
  })
}

export function handlePaper(condition) {
  return request({
    url: '/exam/handlePaper',
    method: 'post',
    params: condition
  })
}

export function toGetQuestion(condition) {
  return request({
    url: '/exam/toGetQuestion',
    method: 'post',
    params: condition
  })
}

export function toStoreQuestion(data) {
  return request({
    url: '/exam/toStoreQuestion',
    method: 'post',
    data: data
  })
}

export function toSaveIdArr(data) {
  return request({
    url: '/exam/toSaveIdArr',
    method: 'post',
    params: data
  })
}

export function togetPapers(data) {
  return request({
    url: '/exam/getWithoutTopic',
    method: 'get',
    params: data
  })
}

export function toSavePaperId(data) {
  return request({
    url: '/exam/toSavePaperId',
    method: 'post',
    data: data
  })
}

